home *** CD-ROM | disk | FTP | other *** search
/ Complete Linux / Complete Linux.iso / docs / apps / circuits / spice2g6.z / spice2g6 / spice / Fortran / nxtpwr.f < prev    next >
Encoding:
Text File  |  1989-02-03  |  897 b   |  43 lines

  1.       subroutine nxtpwr(pwrseq,pdim)
  2.       implicit double precision (a-h,o-z)
  3. c
  4. c     this routine determines the 'next' set of exponents for the
  5. c different dimensions of a polynomial.
  6. c
  7.       integer pwrseq(1),pdim,psum
  8. c
  9. c
  10.       if (pdim.eq.1) go to 80
  11.       k=pdim
  12.    10 if (pwrseq(k).ne.0) go to 20
  13.       k=k-1
  14.       if (k.ne.0) go to 10
  15.       go to 80
  16.    20 if (k.eq.pdim) go to 30
  17.       pwrseq(k)=pwrseq(k)-1
  18.       pwrseq(k+1)=pwrseq(k+1)+1
  19.       go to 100
  20.    30 km1=k-1
  21.       do 40 i=1,km1
  22.       if (pwrseq(i).ne.0) go to 50
  23.    40 continue
  24.       pwrseq(1)=pwrseq(pdim)+1
  25.       pwrseq(pdim)=0
  26.       go to 100
  27.    50 psum=1
  28.       k=pdim
  29.    60 if (pwrseq(k-1).ge.1) go to 70
  30.       psum=psum+pwrseq(k)
  31.       pwrseq(k)=0
  32.       k=k-1
  33.       go to 60
  34.    70 pwrseq(k)=pwrseq(k)+psum
  35.       pwrseq(k-1)=pwrseq(k-1)-1
  36.       go to 100
  37.    80 pwrseq(1)=pwrseq(1)+1
  38. c
  39. c  finished
  40. c
  41.   100 return
  42.       end
  43.